Array.prototype.myFindIndex = function (fn, thisArg) {
    for (let i = 0; i < this.length; i++) {

        if (fn.call(thisArg, this[i], i, this)) {
            return i
        }
        return -1
    }
}
let arr = [1, 4, 6, , 7]
console.log(arr.myFindIndex(item => item === 0));